Add a conditional to not append objects

Hello,

I have another simple question, seeing that I still have yet to find the online DXL reference manual after my company upgraded to v9.3 DOORs.  I had the pdf manuals for 8.3, but our IT group can't seem to find the install disks for 9.3 anymore.

I created a DXL attribute to export these 4 attributes.  (see below) I basically used the Attribute DXL wizard, then added some square brackets to the output on 2 attributes.   For the attributes that have a Type = Heading, I don't want to export the "Object Identifier" and the "Type".  What would be the syntax to change this DXL script below to make that happen.  It may be nice to have a variable to turn the attribute on or off. 

Thanks,

Rick

// DXL generated on 23 May 2014 by Attribute DXL wizard, Version 1.0

// The wizard will use the following comments on subsequent runs
// to determine the selected options and attributes. It will not
// take account of any manual changes in the body of the DXL code.

// begin parameters (do not edit)
// One attribute/property per line: false
// Show attribute/property names: false
// Include OLE objects in text: false
// Attribute: Object Identifier
// Attribute: Object Heading
// Attribute: Object Text
// Attribute: Type
// end parameters (do not edit)

Module m
AttrDef ad
AttrType at
m = module obj
ad = find(m,attrDXLName)
if(!null ad && ad.object)
{
    at = ad.type
    if(at.type == attrText)
    {
        string s
        Buffer val = create
        Buffer temp = create
        probeRichAttr_(obj,"Object Identifier", temp, false)
        val += "["
  val += tempStringOf temp
        val += "] "
        ad = find(m,"Object Heading")
        if(!null ad)
        {
            probeRichAttr_(obj,"Object Heading", temp, false)
            val += tempStringOf temp
            val += "  "
        }
        ad = find(m,"Object Text")
        if(!null ad)
        {
            probeRichAttr_(obj,"Object Text", temp, false)
            val += tempStringOf temp
            val += "  "
        }
        ad = find(m,"Type")
        if(!null ad)
        {
            probeRichAttr_(obj,"Type", temp, false)
           val += "["
     val += tempStringOf temp
            val += "] "
        }
        obj.attrDXLName =  richText (tempStringOf val)
        delete val
        delete temp
    }
}


rsilverman - Fri May 23 11:43:50 EDT 2014

Re: Add a conditional to not append objects
llandale - Fri May 23 11:53:40 EDT 2014

  • string Type = probeAttr_(obj, "Type")
  • if (Type != "Heading")
  • { ...

You are using tempStringOf() incorrectly.  It can only be used if you immediately dispose of the value, such as in a print, setting to an attr or DBE, write to a file etc.  It returns an address of the buffer; so when you subsequently re-fill the buffer you have erased the original string in the string variable.

You don't really need all the "ad = find" statements.  probeAttr_ checks for errors so you don't need to

  • val += "["
  • val += probeAttr_(obj, "Type")
  • val += "]"

-Louie

Re: Add a conditional to not append objects
Mike.Scharnow - Fri May 23 13:56:20 EDT 2014

as to your other question: the dxl manual can be found at http://pic.dhe.ibm.com/infocenter/doorshlp/v9r5/topic/com.ibm.doors.requirements.doc/topics/dxl_reference_manual.pdf (not directly for  9.3, but you get the information what changed in 9.4 or 9.5)

9.3 manual can be found at http://de.scribd.com/doc/97850954/Dxl-Reference-Manual-9-3

Re: Add a conditional to not append objects
rsilverman - Fri May 23 14:35:26 EDT 2014

llandale - Fri May 23 11:53:40 EDT 2014

  • string Type = probeAttr_(obj, "Type")
  • if (Type != "Heading")
  • { ...

You are using tempStringOf() incorrectly.  It can only be used if you immediately dispose of the value, such as in a print, setting to an attr or DBE, write to a file etc.  It returns an address of the buffer; so when you subsequently re-fill the buffer you have erased the original string in the string variable.

You don't really need all the "ad = find" statements.  probeAttr_ checks for errors so you don't need to

  • val += "["
  • val += probeAttr_(obj, "Type")
  • val += "]"

-Louie

Louie,

 

Thank you for your answer.  Something happenned though when I added the if (Type !="Heading") statement, now I can't get the Word Export to include the Paragraph Style applied to the ouput.  Weird.

 

-Rick

Re: Add a conditional to not append objects
rsilverman - Fri May 23 14:46:51 EDT 2014

Mike.Scharnow - Fri May 23 13:56:20 EDT 2014

as to your other question: the dxl manual can be found at http://pic.dhe.ibm.com/infocenter/doorshlp/v9r5/topic/com.ibm.doors.requirements.doc/topics/dxl_reference_manual.pdf (not directly for  9.3, but you get the information what changed in 9.4 or 9.5)

9.3 manual can be found at http://de.scribd.com/doc/97850954/Dxl-Reference-Manual-9-3

Thanks!

Re: Add a conditional to not append objects
rsilverman - Fri May 23 15:53:43 EDT 2014

llandale - Fri May 23 11:53:40 EDT 2014

  • string Type = probeAttr_(obj, "Type")
  • if (Type != "Heading")
  • { ...

You are using tempStringOf() incorrectly.  It can only be used if you immediately dispose of the value, such as in a print, setting to an attr or DBE, write to a file etc.  It returns an address of the buffer; so when you subsequently re-fill the buffer you have erased the original string in the string variable.

You don't really need all the "ad = find" statements.  probeAttr_ checks for errors so you don't need to

  • val += "["
  • val += probeAttr_(obj, "Type")
  • val += "]"

-Louie

Louie,

It was my mistake why the Word Export was not exporting the "Paragraph Styles" .  I accidently renamed the "Group Text" which made the "Paragraph Style" invalid.  Was I renamed the attribute correctly the Word Export included the Styles.

Thanks,

Rick